﻿using System.Text;

namespace Kurax.BoardGames.Client.Engine {
    public class Credentials {
        private byte[] key;

        public byte[] Key {
            get {
                if(this.key == null) {
                    if(GameContext.Current.User.Id == null)
                        return new byte[16];
                    this.key = (new MD5Managed()).ComputeHash(Encoding.UTF8.GetBytes(GameContext.Current.User.Id));
                }
                return this.key;
            }
        }
    }
}
